package com.cysoft.domain;

import org.optaplanner.core.api.domain.autodiscover.AutoDiscoverMemberType;
import org.optaplanner.core.api.domain.solution.PlanningEntityCollectionProperty;
import org.optaplanner.core.api.domain.solution.PlanningScore;
import org.optaplanner.core.api.domain.solution.PlanningSolution;
import org.optaplanner.core.api.domain.solution.ProblemFactCollectionProperty;
import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider;
import org.optaplanner.core.api.score.buildin.bendable.BendableScore;
import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore;
import org.optaplanner.core.api.score.buildin.hardsoftlong.HardSoftLongScore;

import java.util.List;

/**
 * @author caiye
 */
@PlanningSolution(autoDiscoverMemberType = AutoDiscoverMemberType.FIELD)
public class TaskSolution extends AbstractPersistable{
//    @PlanningScore
//    private HardSoftScore score;
    @PlanningScore
    private HardSoftScore score = HardSoftScore.ZERO;

    @ValueRangeProvider(id = "machineRange")
    @ProblemFactCollectionProperty
    private List<Machine> machineList;

    /**
     * 模具列表
     */
//    @ValueRangeProvider(id = "moldRange")
    @ProblemFactCollectionProperty
    private List<Mold> moldList;

    /**
     * 排产任务
     */
    @ValueRangeProvider(id = "taskRange")
    @PlanningEntityCollectionProperty
    private List<Task> taskList;

    /**
     * 轮型列表
     */
    @ProblemFactCollectionProperty
    private List<Wheel> wheelList;



    public TaskSolution() {
        this.score = HardSoftScore.ZERO;
    }

    public TaskSolution(List<Machine> machineList, List<Wheel> wheelList, List<Mold> moldList, List<Task> taskList) {
        this.machineList = machineList;
        this.wheelList = wheelList;
        this.moldList = moldList;
        this.taskList = taskList;
        this.score = HardSoftScore.ZERO;
    }

    public HardSoftScore getScore() {
        return score;
    }

    public void setScore(HardSoftScore score) {
        this.score = score;
    }

    public List<Machine> getMachineList() {
        return machineList;
    }

    public void setMachineList(List<Machine> machineList) {
        this.machineList = machineList;
    }

    public List<Wheel> getWheelList() {
        return wheelList;
    }

    public void setWheelList(List<Wheel> wheelList) {
        this.wheelList = wheelList;
    }

    public List<Mold> getMoldList() {
        return moldList;
    }

    public void setMoldList(List<Mold> moldList) {
        this.moldList = moldList;
    }

    public List<Task> getTaskList() {
        return taskList;
    }

    public void setTaskList(List<Task> taskList) {
        this.taskList = taskList;
    }
}